<template>
  <div class="avue-logo">
    <transition name="fade">
      <div v-if="keyCollapse" class="logoImg" key="0">
        <img :src="userConfig.titleLogo" />
      </div>
    </transition>
    <transition-group name="fade">
      <template v-if="!keyCollapse">
        <!-- <span class="avue-logo_title"
              key="1">{{website.indexTitle}} </span> -->
        <div key="1" class="logoHead">
          <div class="logoImg">
            <img :src="userConfig.titleLogo" />
          </div>
<!--          <h1 class="webTitle">企业成长平台</h1>-->
        </div>
      </template>
    </transition-group>
  </div>
</template>

<script>
import { mapGetters } from "vuex";
export default {
  name: "logo",
  data() {
    return {
      userConfig: [],
    };
  },
  created() { },
  mounted() {
    this.onload()
  },
  computed: {
    ...mapGetters(["website", "keyCollapse"])
  },
  methods: {
    onload: function () {
      var vm = this
      axios.get('/circlelogin/get').then(res => {
        vm.userConfig = res.data.data
      })
    }
  }
};
</script>

<style lang="scss">
.fade-leave-active {
  transition: opacity 0.2s;
}
.fade-enter-active {
  transition: opacity 2.5s;
}
.fade-enter,
.fade-leave-to {
  opacity: 0;
}
.avue-logo {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 164px !important;
  line-height: 64px;
  // background-color: #20222a;
  background-color: #fff;
  font-size: 20px;
  overflow: hidden;
  box-sizing: border-box;
  box-shadow: none !important;
  // box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.15);
  // color: rgba(255, 255, 255, 0.8);
  color: #333;
  z-index: 1024;
  &_title {
    display: block;
    text-align: center;
    font-weight: 300;
    font-size: 16px;
  }
  &_subtitle {
    display: block;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    // color: #fff;
    color: #333;
  }
}
.logoImg {
  width: 100%;
  height: 80px!important;
  // height: 100%;
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.logoImg img {
  height: 70%!important;
  // height: 70px;
}
.avue--collapse {
  .avue-logo {
    height: 60px;
  }
  .logoImg {
    width: 60px;
    height: 60px;
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }
  .logoImg img {
    width: 50px;
  }
}

.avue-logo {
  padding: 20px;
  box-sizing: border-box;
  &::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    background: #e8ebf4;
    height: 1px;
  }
}
.logoHead {
  .webTitle {
    font-size: 24px;
    color: #6299ff;
    text-align: center;
    font-weight: 500;
    margin: 0;
    padding: 0;
  }
}
</style>
